package com.bright.cwduijie.duijie.repository;

import com.bright.cwduijie.duijie.pojo.po.VoucherEntry;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface VoucherEntryRepository extends JpaRepository<VoucherEntry, Integer>, JpaSpecificationExecutor<VoucherEntry> {

    @Query("from VoucherEntry where DATA_KEY=:dataKey")
    List<VoucherEntry> getAllByDataKey(@Param("dataKey") String dataKey);

    @Query("from VoucherEntry where ZT_DATA_KEY=:ztDataKey")
    List<VoucherEntry> getAllByZtDataKey(@Param("ztDataKey") String ztDataKey);

}